Multiple organ systems, including the brain, which undergoes changes that may increase the risk of cognitive decline, are adversely affected by diabetes mellitus (DM). Here, we demonstrate that type 2 diabetes mellitus (T2DM) db/db mice exhibited hippocampus-dependent memory impairment, which might associate with a reduction in dendritic spine density in the pyramidal neurons of brain, Aβ1-42 deposition in the prefrontal cortex (PFC) and hippocampus, and a decreased expression of neurostructural proteins including microtubule-associated protein (MAP2), a marker of dendrites, and postsynaptic density 95 (PSD95), a marker of excitatory synapses. To investigate the effects of the ZiBuPiYin recipe (ZBPYR), a traditional Chinese medicine recipe, on diabetes-related cognitive decline (DACD), db/db mice received daily administration of ZBPYR over an experimental period of 6 weeks. We then confirmed that ZBPYR rescued learning and memory performance impairments, reversed dendritic spine loss, reduced Aβ1-42 deposition and restored the expression levels of MAP2 and PSD95. The present study also revealed that ZBPYR strengthened brain leptin and insulin signaling and inhibited GSK3β overactivity, which may be the potential mechanism or underlying targets of ZBPYR. These findings conclude that ZBPYR prevents DACD, most likely by improving dendritic spine density and attenuating brain leptin and insulin signaling pathway injury. Our findings provide further evidence for the effects of ZBPYR on DACD.